package flc.ast.adapter;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.stark.irremote.lib.net.bean.IrCity;

import flc.ast.R;
import stark.common.basic.adaptermutil.StkProviderMultiAdapter;
import stark.common.basic.adaptermutil.StkSingleSpanProvider;

public class SelCityAdapter extends StkProviderMultiAdapter<IrCity> {

    public SelCityAdapter() {
        addItemProvider(new StkSingleSpanProvider(25));
        addItemProvider(new SelCityProvider());
    }

    private class SelCityProvider extends BaseItemProvider<IrCity> {
        @Override
        public int getItemViewType() {
            return StkProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_address;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, IrCity bean) {
            baseViewHolder.setText(R.id.tvAddressItemText, bean.name);
        }
    }
}
